package com.rongzhe.house.house.service;

import com.alibaba.fastjson.JSONObject;
import com.rongzhe.house.common.resp.ApiResult;
import com.rongzhe.house.house.criteria.HouseCriteria;
import com.rongzhe.house.house.criteria.HouseMapCriteria;
import com.rongzhe.house.house.entity.*;

import java.util.List;

/**
 * Created by hggxg on 2017/11/16.
 */
public interface HouseService {
    /**
     * 房屋委托
     *
     * @param delegationApply
     * @return
     */
    boolean delegationApply(HouseDelegationApply delegationApply,Integer userId);
    /**
     * 生活服务
     * @param type
     * @return
     */
    List<LifeService> getLifeService(Integer type);
    /**
     *已经收藏房源
     *
     * @param houseId
     * @param userId
     * @return
     */
    boolean hasCollection(Integer houseId, Integer userId);
    /**
     * 收藏房源
     *
     * @param houseId
     * @param userId
     * @return
     */
    boolean collection(Integer houseId, Integer userId);
    /**
     * 首页模块数据（合租、整租、直租）
     * @param cityId
     * @param isEntreRent
     * @param isOwnerRent
     * @return
     */
    ApiResult getExcellentHouse(String cityId, boolean isEntreRent, boolean isOwnerRent);

    /**
     * 通过id查询房源，以及更多详细信息
     * @param ids
     * @return
     */
    List<HouseOverview> selectHouseByIds(List<Long> ids);
    /**
     * 通过id查询房源并指定排序）
     * @param ids
     * @param orderStr
     * @param order
     * @return
     */
    List<HouseOverview> selectHouseByIds(List<Long> ids,String orderStr,String order);

    /**
     * 地图搜索
     * @param houseCriteria
     * @return
     */
    public JSONObject map(HouseMapCriteria houseCriteria);

    /**
     * 地图区域数量统计
     * @param houseCriteria
     * @return
     */
    List<HouseMapCriteria> queryCityMapCount(HouseMapCriteria houseCriteria);
    /**
     * 获取优质房源
     *
     * @return
     */
    List<HouseOverview> getExcellentHouse(String cityId);


    /**
     * 条件筛选
     *
     * @return
     */
    List<HouseOverview> queryHouseByCriteria(HouseCriteria houseCriteria);

    /**
     * 详情
     *
     * @param houseId
     * @return
     */
    HouseDetail detail(Integer houseId);


    /**
     * 获取房源支付信息
     *
     * @param houseId
     * @return
     */
    List<HouseRentPaymentConfig> getHouseRentPayConfigListByHouseId(Integer houseId);
}
